public class TheNum9Count {//统计1到100中9出现的次数
    public static void main(String[] args) {
        int i = 0;
        int count9 = 0;
        for(i=1; i <= 100; i++) {
            int temp =i;
            if(i>10) {
                if(i % 10 ==9) {
                    count9++;
                }
                if((i=i/10)==9) {
                    count9++;
                }
                i =temp;
            }else if(i == 9) {
                count9++;
            }
        }
        System.out.println(count9);
    }
}
